package com.tyut.domain;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 标签文档实体类，用于Elasticsearch存储
 */
@Data
@Accessors(chain = true)
@Document(indexName = "tag")
public class TagDocument {

    /**
     * 标签ID
     */
    @Id
    private String id;

    /**
     * 标签名称
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String name;

    /**
     * 标签描述
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String description;

    /**
     * 使用次数
     */
    @Field(type = FieldType.Integer)
    private Integer useCount;

    /**
     * 标签类型
     */
    @Field(type = FieldType.Keyword)
    private String type;
} 